#include <bits/stdc++.h>
using namespace std;

int n;
int main() {
    cin >> n;
    int s = 0;
    if (n % 3 == 0) {
        s++;
        cout << "3 ";
    }
    if (n % 5 == 0) {
        s++;
        cout << "5 ";
    }
    if (n % 7 == 0) {
        s++;
        cout << "7 ";
    }
    if (s == 0)
        cout << "n";

    return 0;
}